package com.raos.orderservice.listener;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

/**
 * 自定义 springboot 启动成功事件发送后的监听处理器
 *
 * @author raos
 * @emil 991207823@qq.com
 * @date 2022/9/6 21:14
 */
public class ZkApplicationListener implements ApplicationListener<ContextRefreshedEvent> {

    // 当Spring Boot执行refresh方法到最后的finishRefresh的时候，就会发布ContextRefreshedEvent
    // 如果ContextRefreshedEvent类型发布了，就会被我这个监听器监听到，并且进行回调
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        System.out.println("spring boot终于启动成功了...");
    }

}